<!DOCTYPE html>
<!--[if IE 8]> <html lang="en" class="ie8"> <![endif]-->
<!--[if IE 9]> <html lang="en" class="ie9"> <![endif]-->
<!--[if !IE]><!--> <html lang="en"> <!--<![endif]-->
<!-- BEGIN HEAD -->
<head>
    <meta charset="utf-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta content="width=device-width, initial-scale=1" name="viewport"/>

    {{-- 让 360 浏览器用 webkit 内核渲染页面 --}}
    <meta name="renderer" content="webkit">

    <!-- CSRF Token -->
    <meta name="token" content="{{ csrf_token() }}">

    <title>后台管理系统</title>

    {{-- 临时阻止 favicon.ico 请求, todo: 新建一个 favicon.ico --}}
    <link rel="shortcut icon" href="data:image/x-icon;," type="image/x-icon">

    <!-- BEGIN GLOBAL MANDATORY STYLES -->

    <!-- END GLOBAL MANDATORY STYLES -->
    <!-- BEGIN THEME STYLES -->
    <link href="/css/admin/global/components.css" rel="stylesheet"/>
    <link href="/css/admin/global/plugins.css" rel="stylesheet"/>
    <link href="/css/admin/layouts/layout/layout.css" rel="stylesheet"/>

    @if(auth()->guard('admin')->user())
        <link href="/css/admin/layouts/layout/themes/darkblue.css" rel="stylesheet"/>
    @endif

    <link href="/css/admin/layouts/custom.css" rel="stylesheet"/>
    <!-- END THEME STYLES -->

    {{-- VIEW STYLES --}}
    @yield('css')

    {{-- 在 IE 浏览器上中文用微软雅黑 --}}
    <!--[if IE]>
    <style>
        html, body, div, span, applet, object, iframe,
        h1, h2, h3, h4, h5, h6, p, blockquote, pre,
        a, abbr, acronym, address, big, cite, code,
        del, dfn, em, img, ins, kbd, q, s, samp,
        small, strike, strong, sub, sup, tt, var,
        b, u, i, center,
        dl, dt, dd, ol, ul, li,
        fieldset, form, label, legend,
        table, caption, tbody, tfoot, thead, tr, th, td,
        article, aside, canvas, details, embed,
        figure, figcaption, footer, header, hgroup,
        menu, nav, output, ruby, section, summary,
        time, mark, audio, video, form,input,textarea,select {
            font-family: Helvetica, Tahoma, "Microsoft Yahei", sans-serif!important;
        }
        i.fa, i.fa:before, i.fa:after {
            font-family: 'FontAwesome';
        }
    </style>
    <![endif]-->

    <!--[if lt IE 9]>
    <script src="/vendor/js/html5shiv-printshiv.min.js"></script>
    <script src="/vendor/js/respond.min.js"></script>
    <![endif]-->
</head>
<!-- END HEAD -->
<body>
@if(auth()->guard('admin')->user())
    <!-- BEGIN HEADER -->
    <div class="page-header navbar navbar-fixed-top">
        <!-- BEGIN HEADER INNER -->
        <div class="page-header-inner">
            <!-- BEGIN LOGO -->
            <div class="page-logo">
                <a href="/admin/carousels">
                    {{--<img src="../assets/layouts/layout/img/logo.png" alt="logo" class="logo-default"/>--}}

                    后台管理系统
                </a>
                <div class="menu-toggler sidebar-toggler hide">
                    <!-- DOC: Remove the above "hide" to enable the sidebar toggler button on header -->
                </div>
            </div>
            <!-- END LOGO -->
            <!-- BEGIN RESPONSIVE MENU TOGGLER -->
            <a href="javascript:;" class="menu-toggler responsive-toggler" data-toggle="collapse" data-target=".navbar-collapse">
                <span></span>
            </a>
            <!-- END RESPONSIVE MENU TOGGLER -->
            <!-- BEGIN TOP NAVIGATION MENU -->
            <div class="top-menu">
                <ul class="nav navbar-nav pull-right">
                    <!-- BEGIN USER LOGIN DROPDOWN -->
                    <li class="dropdown dropdown-user">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown" data-hover="dropdown" data-close-others="true">
                            <span class="username"> {{ auth()->guard('admin')->user() ? auth()->guard('admin')->user()->name : '' }} </span>
                            <i class="fa fa-angle-down"></i>
                        </a>
                        <ul class="dropdown-menu">
                            <li>
                                <a href="/admin/logout" onclick="event.preventDefault();
            document.getElementById('logout-form').submit();">
                                    <i class="icon-key"></i> 退出 </a>

                                <form id="logout-form" action="{{ url('/admin/logout') }}" method="POST" style="display: none;">
                                    {{ csrf_field() }}
                                </form>
                            </li>
                        </ul>
                    </li>
                    <!-- END USER LOGIN DROPDOWN -->
                </ul>
            </div>
            <!-- END TOP NAVIGATION MENU -->
        </div>
        <!-- END HEADER INNER -->
    </div>
    <!-- END HEADER -->

    {{--<div class="clearfix"></div>--}}

    <div class="page-container">

        @include('components.page-sidebar')

            <!-- BEGIN PAGE CONTENT -->
        <div class="page-content-wrapper">
            <!-- BEGIN CONTENT -->
            <div class="page-content" id="page_content">

                {{-- BEGIN FLASH MESSAGE --}}
                @if(session('flash_error_message'))
                    <div class="alert alert-danger alert-dismissible" role="alert">
                        <button type="button" class="close" data-dismiss="alert"><span>&times;</span></button>
                        {{ session('flash_error_message') }}
                    </div>
                @elseif(session('flash_success_message'))
                    <div class="alert alert-success alert-dismissible" role="alert">
                        <button type="button" class="close" data-dismiss="alert"><span>&times;</span></button>
                        {{ session('flash_success_message') }}
                    </div>
                @endif
                {{-- END FLASH MESSAGE --}}

                {{-- VIEW CONTENT --}}
                @yield('content')

            </div>
            <!-- END CONTENT -->
        </div>
        <!-- END PAGE CONTENT -->
    </div>
@else
    <!-- BEGIN NON AUTHENTICATED USER PAGE CONTENT -->
    @yield('content')
    <!-- END NON AUTHENTICATED USER PAGE CONTENT -->
@endif

<!-- Scripts -->
<script src="/vendor/js/jquery.min.js"></script>
<script src="/vendor/js/bootstrap.min.js"></script>
<script src="/vendor/js/moment.min.js"></script>
<script src="/vendor/js/bootstrap-datetimepicker.min.js"></script>
<script src="/vendor/js/js.cookie.min.js"></script>
<script src="/vendor/js/lodash.min.js"></script>
<script src="/vendor/js/sprintf.min.js"></script>
<script src="/vendor/js/jquery.validate.min.js"></script>
<script src="/vendor/js/sweetalert.min.js"></script>
<script src="/vendor/js/packager.min.js"></script>

<script>
    // 增加表单验证文件的翻译
    // 替换所有变量标记为字符串格式
    var Phrases = {!! str_replace([
            ':attribute',
            ':min',
            ':max',
            ':format',
            ':digits',
            ':values',
            ':other',
            ':size',
        ], '%s', json_encode($translations)) !!};

    // 全局 ajax 表单提交使用的 csrf token
    $.ajaxSetup({
        headers: {'X-CSRF-TOKEN': "{{ csrf_token() }}"}
    });
</script>


<script src="/js/admin/app.js"></script>
<script src="/js/admin/config.js"></script>
<script src="/js/admin/components/form.js"></script>
<script src="/js/admin/components/table.js"></script>
<script src="/js/admin/components/sidebar.js"></script>


<script>
    $(function() {
        // init app
        app.init();
    });
</script>

{{-- VIEW JS --}}
@yield('js')

</body>
</html>
